
import { PipeTransform, Pipe } from '@angular/core';
import { Employee } from './index';
import { debug } from 'util';

@Pipe({ name: 'rowTemplate' })
export class DataGridRowTemplatePipe implements PipeTransform {
    transform(value: any, ...args: any[]) {
        const row = value as Employee;
        const rn = !row.ParentId ? true : false;
        return rn;
    }
}


@Pipe({ name: 'rowStyle' })
export class DataGridRowStylePipe implements PipeTransform {
    transform(value: any, ...args: any[]) {
        debugger;
        const row = value as Employee;
        switch (row.Type) {
            case 0:
                return 'row-label';
            case 1:
                return 'row-product';
            case 2:
                return 'row-price';
        }
    }
}

